package com.itheima.health.dao;

import com.itheima.health.pojo.CheckGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface CheckGroupMapper extends Mapper<CheckGroup> {

    @Select("SELECT t3.* FROM t_setmeal t1 JOIN t_setmeal_checkgroup t2 ON t1.id = t2.setmeal_id " +
            "JOIN t_checkgroup t3 ON t2.checkgroup_id = t3.id WHERE t1.id = #{id}")
    List<CheckGroup> findBySetmealId(@Param("id") Integer id);
}
